package com.project.util;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class PressException {
    //当服务器抛出指定异常，或该异常的子类对象时，执行该方法
    @ExceptionHandler({AuthorizationException.class, UnauthorizedException.class})
    public String noPermission(){
        return "noPermission";
    }
}
